package com.zyf.chapter02.structure.adapter.example2.refactor;

import com.zyf.chapter02.structure.adapter.example2.ASensitiveWordsFilter;

/**
 * A 敏感词过滤系统适配器
 * @author yifeng
 */
public class ASensitiveWordsFilterAdaptor implements ISensitiveWordsFilter{
    private ASensitiveWordsFilter aFilter;

    public ASensitiveWordsFilterAdaptor(ASensitiveWordsFilter aFilter) {
        this.aFilter = aFilter;
    }

    @Override
    public String filter(String text) {
        String maskedText = aFilter.filterSexyWords(text);
        maskedText = aFilter.filterPoliticalWords(maskedText);
        return maskedText;
    }
}
